import ctMapCircle from '../src/components/circle';
import cluster from '../src/components/cluster';
import ctMapDrawTool from '../src/components/draw';
import ctMapHeat from '../src/components/heat';
import ctMapLink from '../src/components/link';
import ctMapLine from '../src/components/line';
import ctMap from '../src/components/mainmap';
import ctMapMarker from '../src/components/marker';
import ctMapMultiMarker from '../src/components/multimarker';
import ctMapPolygon from '../src/components/polygon';
import ctMapTrack from '../src/components/track';
import ctMeasuretool from '../src/components/measuretool';
import citySelect from '../src/components/citySelect';
// ...如果还有的话继续添加

const components = [ctMapCircle, cluster, ctMapDrawTool, ctMapHeat, ctMapLink, ctMapLine, ctMap, ctMapMarker, ctMapMultiMarker, ctMapPolygon, ctMapTrack, ctMeasuretool, citySelect
  // ...如果还有的话继续添加,
]

const install = function (Vue, opts = {}) {
  components.map(component => {
    Vue.component(component.name, component);
  })
}

/* 支持使用标签的方式引入 */
if (typeof window !== 'undefined' && window.Vue) {
  install(window.Vue);
}

export default {
  install,
  ctMapCircle,
  cluster,
  ctMapDrawTool,
  ctMapHeat,
  ctMapLink,
  ctMapLine,
  ctMap,
  ctMapMarker,
  ctMapMultiMarker,
  ctMapPolygon,
  ctMapTrack,
  ctMeasuretool,
  citySelect
  // ...如果还有的话继续添加
}
